home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Compilers / digital marsC compier / dm / include / excpt.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-03-16  |  2.1 KB  |  97 lines

  1. /* Copyright (C) 1986-2001 by Digital Mars */
  2.  
  3. /*
  4.  * This file contains the declartions necessary
  5.  * to support Structured Exception Handling under NT.
  6.  * This file is compatible with Microsofts version of the same file
  7.  */
  8. #if __SC__ || __RCC__
  9. #pragma once
  10. #endif
  11.  
  12. #ifndef __EXCPT_H
  13. #define __EXCPT_H 1
  14.  
  15.  
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19.  
  20. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  21. #ifndef _CRTAPI1
  22. #define _CRTAPI1 __cdecl
  23. #endif
  24.  
  25. /* Define _CRTAPI2 (for compatibility with the NT SDK) */
  26. #ifndef _CRTAPI2
  27. #define _CRTAPI2 __cdecl
  28. #endif
  29.  
  30. /* Define CRTIMP */
  31. #ifndef _CRTIMP
  32. #if defined(_WIN32) && defined(_DLL)
  33. #define _CRTIMP  __declspec(dllimport)
  34. #else
  35. #define _CRTIMP
  36. #endif
  37. #endif
  38.  
  39. /*
  40.  * Exception disposition return values.
  41.  */
  42. typedef enum _EXCEPTION_DISPOSITION {
  43.     ExceptionContinueExecution,
  44.     ExceptionContinueSearch,
  45.     ExceptionNestedException,
  46.     ExceptionCollidedUnwind
  47. } EXCEPTION_DISPOSITION;
  48.  
  49.  
  50. /*
  51.  * Prototype for Structured Exception Handling Support Routine
  52.  */
  53. struct _EXCEPTION_RECORD;
  54. struct _CONTEXT;
  55.  
  56. EXCEPTION_DISPOSITION __cdecl _except_handler (
  57.     struct _EXCEPTION_RECORD *ExceptionRecord,
  58.     void * EstablisherFrame,
  59.     struct _CONTEXT *ContextRecord,
  60.     void * DispatcherContext
  61.     );
  62.     
  63.  
  64. #if    !defined(__cplusplus)
  65. #define try                __try
  66. #define except                __except
  67. #define finally             __finally
  68. #define leave                __leave
  69. #endif    
  70.  
  71. /*
  72.  * Compiler intrinsics 
  73.  */
  74. #define GetExceptionCode        _exception_code
  75. #define exception_code            _exception_code
  76. #define GetExceptionInformation     (struct _EXCEPTION_POINTERS *)_exception_info
  77. #define exception_info            (struct _EXCEPTION_POINTERS *)_exception_info
  78. #define AbnormalTermination        _abnormal_termination
  79. #define abnormal_termination        _abnormal_termination
  80.  
  81. unsigned long __cdecl _exception_code(void);
  82. void *          __cdecl _exception_info(void);
  83. int          __cdecl _abnormal_termination(void);
  84.  
  85. /*
  86.  * Legal values for expression in except().
  87.  */
  88. #define EXCEPTION_EXECUTE_HANDLER     1
  89. #define EXCEPTION_CONTINUE_SEARCH     0
  90. #define EXCEPTION_CONTINUE_EXECUTION    -1
  91.  
  92. #ifdef __cplusplus
  93. }
  94. #endif
  95.  
  96. #endif 
  97.